

use UMAS0011_OUTPUT_v2.DTA, clear


svyset[pw=weight]

forvalues i= 1(1)12 {
  replace Q32a_`i' = Q32b_`i' if Q32a_`i'==.
  replace Q32a_`i'=6 if Q32a_`i'==.
  }


* Q1
svy: tab Q1

* Q1a
* WORD CLOUD?

*Q2
svy: tab Q2 area, col
tab Q2 area

*Q2b
svy: tab Q2b area, col
tab Q2b area

* Q3
*HOW TO REPRESENT?

*Q4
svy: tab Q4m_1, col
tab Q4m_1

svy: tab Q4m_2, col
tab Q4m_2

svy: tab Q4m_3, col
tab Q4m_3

svy: tab Q4m_4, col
tab Q4m_4

svy: tab Q4m_5, col
tab Q4m_5

svy: tab Q4m_6, col
tab Q4m_6

svy: tab Q4m_7, col
tab Q4m_7

svy: tab Q4m_t, col
tab Q4m_t

*Q5
svy: tab Q5, col
tab Q5

*Q6
svy: mean Q6
svy: mean Q6 if area==1
svy: mean Q6 if area==2

*Q7
svy: tab Q7 area, col
tab Q7 area

*Q8
svy: tab Q8, col

*Q9a
svy: tab Q9a area, col
tab Q9a area

*Q9b
svy: tab Q9b area, col
tab Q9b area


*Q9a
svy: tab Q9c area, col
tab Q9c area









*Q14
svy: tab Q14m_1 area, col
svy: tab Q14m_2 area, col
svy: tab Q14m_3 area, col
svy: tab Q14m_4 area, col
svy: tab Q14m_5 area, col
svy: tab Q14m_6 area, col
svy: tab Q14m_7 area, col
svy: tab Q14m_8 area, col
svy: tab Q14m_9 area, col
svy: tab Q14m_10 area, col
svy: tab Q14m_11 area, col
svy: tab Q14m_12 area, col
svy: tab Q14m_13 area, col
svy: tab Q14m_14 area, col
svy: tab Q14m_15 area, col
svy: tab Q14m_16 area, col
svy: tab Q14m_17 area, col
svy: tab Q14m_18 area, col
svy: tab Q14_t area, col

*Q15
svy: tab Q15 area, col
tab Q15 area

*Q16
svy: tab Q16 area, col
tab Q16 area

*Q17
svy: tab Q17 area, col
tab Q17 area

*Q18
svy: tab Q18 area, col
tab Q18 area

*Q19
svy: tab Q19 area, col
tab Q19 area

*Q20
svy: tab Q20 area, col
tab Q20 area

*Q21a
svy: tab Q21a area, col
tab Q21a area

*Q21b
svy: tab Q21b area, col
tab Q21b area

*Q22
svy: tab Q22 area, col
tab Q22 area

*approval

*Q23a
svy: tab Q23a area, col
tab Q23a area

*Q23b
svy: tab Q23b area, col
tab Q23b area

*Q23c
svy: tab Q23c area, col
tab Q23c area

*Q23d
svy: tab Q23d area, col
tab Q23d area

*Q24
svy: tab Q24 area, col
tab Q24 area

*Q26
svy: tab Q26 area, col
tab Q26 area



*Q28
svy: tab Q28 area, col
tab Q28 area

*vote choice and reg

*Q29a
svy: tab Q29a, col
tab Q29a

*Q29b
svy: tab Q29b, col
tab Q29b


*Q29a_c1
svy: tab Q29a_c1 area, col
tab Q29a_c1

*Q29b_c1
svy: tab Q29b_c1 area, col
tab Q29b_c1

*Q30
svy: tab Q30 area, col
tab Q30 area

*Q33
svy: tab Q33 area, col
tab Q33 area

*Q34
svy: tab Q34_1
svy: tab Q34_2
svy: tab Q34_3
svy: tab Q34_4
svy: tab Q34_5
svy: tab Q34_6
svy: tab Q34_7
svy: tab Q34_8
svy: tab Q34_9
svy: tab Q34_10
svy: tab Q34_11
svy: tab Q34_12
svy: tab Q34_13

* Q25

recode Q25a_1-Q25r_2 (2=0)

tabstat Q25a_1 Q25b_1 Q25c_1 Q25d_1 Q25e_1 Q25f_1 Q25g_1 Q25h_1 Q25i_1 Q25j_1 Q25k_1 Q25l_1 Q25m_1 Q25n_1 Q25o_1 Q25p_1 Q25q_1 Q25r_1 [aw=weight], c(s) s(mean) by(area)

tabstat Q25a_2 Q25b_2 Q25c_2 Q25d_2 Q25e_2 Q25f_2 Q25g_2 Q25h_2 Q25i_2 Q25j_2 Q25k_2 Q25l_2 Q25m_2 Q25n_2 Q25o_2 Q25p_2 Q25q_2 Q25r_2 [aw=weight], c(s) s(mean) by(area)


* Q3 

twoway histogram Q3 if Q3<997, scheme(s1color) bc(blue) discrete percent aspect(.2) title("Please rate how easy or difficult your commute is on the following scale:", size(med)) xlabel(0 "     Very Easy" 25 50 75 100 "Very Difficult             ") xtitle(" ")
graph export q3.pdf, replace




*Q32 RanKING QUESTIOn

drop zipcode
ren lookupzip zipcode
sort zipcode

merge zipcode using combinedzipcodes
drop if _m==2
drop _m

gen partyreg= Q29a_c1
replace partyreg= Q29b_c1 if partyreg==.

tab partyreg, gen(party)

ren party1 democrat
ren party2 republican
ren party3 unenrolled
recode democrat-unenrolled (.=0)



svyset [pw=weight]

label define ranking 1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "Not_Ranked"
label values Q32a_1-Q32a_12 ranking 

forvalues i= 1(1)12 {
replace Q32a_`i' = Q32b_`i' if Q32a_`i'==.
replace Q32a_`i'=6 if Q32a_`i'==.
}

* Adults
svy: proportion Q32a_1-Q32a_12 if area==1
parmest, saving(bostonadults1, replace)

svy: proportion Q32a_1-Q32a_12 if area==2
parmest, saving(areaadults1, replace)

svy: proportion Q32a_1-Q32a_12 
parmest, saving(everyoneadults1, replace)

* RVs
svy: proportion Q32a_1-Q32a_12 if area==1 & Q29a<3
parmest, saving(bostonrvs1, replace)

svy: proportion Q32a_1-Q32a_12 if area==2 & (Q29a==3 | Q29b<3)
parmest, saving(arearvs1, replace)

svy: proportion Q32a_1-Q32a_12 if Q29a<4 | Q29b<3
parmest, saving(everyonervs1, replace)



gen connollywalsh=1 if Q32a_8<Q32a_7
gen connollyconley=1 if Q32a_8<Q32a_11
gen connollyconsalvo=1 if Q32a_8<Q32a_4

replace connollywalsh=0 if Q32a_8>Q32a_7
replace connollyconley=0 if Q32a_8>Q32a_11
replace connollyconsalvo=0 if Q32a_8>Q32a_4

forvalues i = 1(1)12 {

recode Q32a_`i' 2/3=1 4/6=0, gen(top3_`i')
}

svy: proportion top3_1-top3_2, over(area)

forvalues i = 1(1)12 {

recode Q32a_`i' 2/5=1 6=0, gen(top5_`i')
}

svy: proportion top5_1-top5_12, over(area)

use bostonadults1, clear

keep eq parm estimate

replace eq="Charles L. Clemons Jr." if eq=="Q32a_1"replace eq="Bill Walczak" if eq=="Q32a_2"replace eq="Charles Calvin Yancey" if eq=="Q32a_3"replace eq="Rob Consalvo" if eq=="Q32a_4"replace eq="Charlotte Golar Richie" if eq=="Q32a_5"replace eq="Michael P. Ross" if eq=="Q32a_6"replace eq="Martin J. Walsh" if eq=="Q32a_7"replace eq="John R. Connolly" if eq=="Q32a_8"replace eq="Felix G. Arroyo" if eq=="Q32a_9"replace eq="David James Wyatt" if eq=="Q32a_10"replace eq="Daniel F. Conley" if eq=="Q32a_11"replace eq="John F. Barros" if eq=="Q32a_12"

gen ranking=real(parm)
recode ranking .=6
* fillin eq ranking

drop parm

reshape wide estimate, i(eq) j(ranking)
outsheet using bostonadults1.csv , comma replace

use areaadults1, clear

keep eq parm estimate

replace eq="Charles L. Clemons Jr." if eq=="Q32a_1"replace eq="Bill Walczak" if eq=="Q32a_2"replace eq="Charles Calvin Yancey" if eq=="Q32a_3"replace eq="Rob Consalvo" if eq=="Q32a_4"replace eq="Charlotte Golar Richie" if eq=="Q32a_5"replace eq="Michael P. Ross" if eq=="Q32a_6"replace eq="Martin J. Walsh" if eq=="Q32a_7"replace eq="John R. Connolly" if eq=="Q32a_8"replace eq="Felix G. Arroyo" if eq=="Q32a_9"replace eq="David James Wyatt" if eq=="Q32a_10"replace eq="Daniel F. Conley" if eq=="Q32a_11"replace eq="John F. Barros" if eq=="Q32a_12"

gen ranking=real(parm)
recode ranking .=6
* fillin eq ranking

drop parm

reshape wide estimate, i(eq) j(ranking)
outsheet using areaadults1.csv , comma replace

use bostonrvs1, clear

keep eq parm estimate

replace eq="Charles L. Clemons Jr." if eq=="Q32a_1"replace eq="Bill Walczak" if eq=="Q32a_2"replace eq="Charles Calvin Yancey" if eq=="Q32a_3"replace eq="Rob Consalvo" if eq=="Q32a_4"replace eq="Charlotte Golar Richie" if eq=="Q32a_5"replace eq="Michael P. Ross" if eq=="Q32a_6"replace eq="Martin J. Walsh" if eq=="Q32a_7"replace eq="John R. Connolly" if eq=="Q32a_8"replace eq="Felix G. Arroyo" if eq=="Q32a_9"replace eq="David James Wyatt" if eq=="Q32a_10"replace eq="Daniel F. Conley" if eq=="Q32a_11"replace eq="John F. Barros" if eq=="Q32a_12"

gen ranking=real(parm)
recode ranking .=6
* fillin eq ranking

drop parm

reshape wide estimate, i(eq) j(ranking)
outsheet using bostonrvs1.csv , comma replace

use arearvs1, clear

keep eq parm estimate

replace eq="Charles L. Clemons Jr." if eq=="Q32a_1"replace eq="Bill Walczak" if eq=="Q32a_2"replace eq="Charles Calvin Yancey" if eq=="Q32a_3"replace eq="Rob Consalvo" if eq=="Q32a_4"replace eq="Charlotte Golar Richie" if eq=="Q32a_5"replace eq="Michael P. Ross" if eq=="Q32a_6"replace eq="Martin J. Walsh" if eq=="Q32a_7"replace eq="John R. Connolly" if eq=="Q32a_8"replace eq="Felix G. Arroyo" if eq=="Q32a_9"replace eq="David James Wyatt" if eq=="Q32a_10"replace eq="Daniel F. Conley" if eq=="Q32a_11"replace eq="John F. Barros" if eq=="Q32a_12"

gen ranking=real(parm)
recode ranking .=6
* fillin eq ranking

drop parm

reshape wide estimate, i(eq) j(ranking)
outsheet using arearvs1.csv , comma replace

use everyoneadults1, clear

keep eq parm estimate

replace eq="Charles L. Clemons Jr." if eq=="Q32a_1"replace eq="Bill Walczak" if eq=="Q32a_2"replace eq="Charles Calvin Yancey" if eq=="Q32a_3"replace eq="Rob Consalvo" if eq=="Q32a_4"replace eq="Charlotte Golar Richie" if eq=="Q32a_5"replace eq="Michael P. Ross" if eq=="Q32a_6"replace eq="Martin J. Walsh" if eq=="Q32a_7"replace eq="John R. Connolly" if eq=="Q32a_8"replace eq="Felix G. Arroyo" if eq=="Q32a_9"replace eq="David James Wyatt" if eq=="Q32a_10"replace eq="Daniel F. Conley" if eq=="Q32a_11"replace eq="John F. Barros" if eq=="Q32a_12"

gen ranking=real(parm)
recode ranking .=6
* fillin eq ranking

drop parm

reshape wide estimate, i(eq) j(ranking)
outsheet using everyoneadults1.csv , comma replace

use everyonervs1, clear

keep eq parm estimate

replace eq="Charles L. Clemons Jr." if eq=="Q32a_1"replace eq="Bill Walczak" if eq=="Q32a_2"replace eq="Charles Calvin Yancey" if eq=="Q32a_3"replace eq="Rob Consalvo" if eq=="Q32a_4"replace eq="Charlotte Golar Richie" if eq=="Q32a_5"replace eq="Michael P. Ross" if eq=="Q32a_6"replace eq="Martin J. Walsh" if eq=="Q32a_7"replace eq="John R. Connolly" if eq=="Q32a_8"replace eq="Felix G. Arroyo" if eq=="Q32a_9"replace eq="David James Wyatt" if eq=="Q32a_10"replace eq="Daniel F. Conley" if eq=="Q32a_11"replace eq="John F. Barros" if eq=="Q32a_12"

gen ranking=real(parm)
recode ranking .=6
* fillin eq ranking

drop parm

reshape wide estimate, i(eq) j(ranking)
outsheet using everyonervs1.csv , comma replace


